<?php

namespace App\Models\Traits;

use App\Models\Product;
use App\Services\UserInviteInfo\UserInviteInfo;

trait HasUserInvite
{
	public function inviteString($product = null)
	{
		return app(UserInviteInfo::class, [
			'user' => $this,
			'product' => $product,
		])->inviteString();
	}
	
	public function inviteQrcode($product = null)
	{
		return app(UserInviteInfo::class, [
			'user' => $this,
			'product' => $product,
		])->inviteQrcode();
	}
	
	public function userInvitePoster()
	{
		return app(UserInviteInfo::class, [
			'user' => $this
		])->userInvitePoster();
	}
	
	public function productInvitePoster(Product $product)
	{
		return app(UserInviteInfo::class, [
			'user' => $this,
			'product' => $product
		])->productInvitePoster();
	}
}
